//
//  TTIVideoPickerManager.h
//  iOSCodeProject
//
//  Created by Fox on 14-7-18.
//  Copyright (c) 2014年 翔傲信息科技（上海）有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <MediaPlayer/MediaPlayer.h>

//成功和失败的回调，成功时返回视频的目标文件的路径和源文件的路径
typedef void(^TTIVideoPickerManagerCompleteBlock)(NSString *resultPath, NSString *orignPath);
typedef void(^TTIVideoPickerManagerFailedBlock)(NSError *error);

typedef NS_ENUM(NSInteger, TTIVideoPickerManagerType) {
    TTIVideoPickerManagerBoth = 0,             //通过相机和选择视频获取
    TTIVideoPickerManagerCamera = 1,           //通过相机获取视频
    TTIVideoPickerManagerAlbum = 2             //通过系统专辑获取视频
};


/**
 *  系统视频选择器：拍摄视频和选择视频
 */
@interface TTIVideoPickerManager : NSObject <UIActionSheetDelegate,UINavigationControllerDelegate,
UIImagePickerControllerDelegate>

/**
 *  创建单例对象
 *
 *  @return 单例对象
 */
+ (TTIVideoPickerManager *)shareInstance;

/**
 *  选取视频
 *
 *  @param styleType     视频类型
 *  @param delegate      委托
 *  @param isConcertMP4  是否转换为MP4
 *  @param completeBlock 完成的block
 *  @param failedBlock   失败的block
 */
- (void)videoPickerWithType:(TTIVideoPickerManagerType )styleType
               withDelegate:(id )delegate
               isConvertMP4:(BOOL)isConcertMP4
               comleteBlock:(TTIVideoPickerManagerCompleteBlock )completeBlock
                failedBlock:(TTIVideoPickerManagerFailedBlock)failedBlock;

@end
